<!DOCTYPE html>
<html
        xmlns="http://www.w3.org/1999/xhtml"
        xmlns:h="http://java.sun.com/jsf/html"
        xmlns:f="http://java.sun.com/jsf/core"
        xmlns:ui="http://java.sun.com/jsf/facelets"
        >

<h:head>
    <title>Index</title>

    <h:outputScript library="js" name="jquery-1.9.1.min.js"></h:outputScript>
    <h:outputScript library="js" name="bootstrap.js"></h:outputScript>
    <h:outputScript library="js" name="loginmodal.js"></h:outputScript>

    <h:outputStylesheet library="css" name="common.css"/>
    <h:outputStylesheet library="css" name="typeface.css"/>
    <h:outputStylesheet library="css" name="bootstrap.css"/>
    <h:outputStylesheet library="css" name="login.css"/>
    <h:outputStylesheet library="css" name="navbar.css"/>

    <f:loadBundle basename="com.dataart.training.crimequalification.facesutils.messages"
                  var="msgs"></f:loadBundle>
    <f:loadBundle basename="com.dataart.training.crimequalification.facesutils.configurations"
                  var="conf"></f:loadBundle>

</h:head>

<f:view>

    <f:metadata>
        <f:event type="preRenderView" listener="#{chooseTaskBean.taskAlreadyChosenRedirect}"/>
    </f:metadata>

    <h:body styleClass="body">

        <h:panelGroup id="navview">
            <ui:include src="/views/navbar.xhtml"/>
        </h:panelGroup>

        <h:panelGroup id="chooseTaskPanel">

            <div class="container-fluid">
                <div class="row-fluid">
                    <div class="span2">
                        <ui:include src="sidebar.xhtml"/>
                    </div>
                    <div class="span10">

                        <div class="container-full-index white-text" style="border-radius: 15px;
                        max-height: 800px; height: 650px; padding: 80px 0 20px; padding-left: 50px;">

                            <p style="font-size: 45px;">Выберите задачу</p>
                            <br/>
                            <br/>


                            <div class="span7 well" style="color: #212121">
                                <h:form>
                                    <table class="table table-striped table-hover pagination-centered">
                                        <thead>
                                        <tr>
                                            <th style="width: 36px;">Номер задания</th>
                                            <th style="width: 50px;">Текст задания</th>
                                            <th style="width: 36px;">Решено раз</th>
                                            <th style="width: 36px;"></th>
                                        </tr>
                                        </thead>

                                        <tbody>
                                        <ui:repeat var="t" value="#{chooseTaskBean.tasks}">
                                            <tr>
                                                <td>${t.taskId}</td>
                                                <td>#{chooseTaskBean.trimTaskText(t)}</td>
                                                <td>0</td>
                                                <td>
                                                    <h:commandLink
                                                            value="выбрать"
                                                            styleClass="btn btn-mini btn-success"
                                                            action="#{chooseTaskBean.composeURLToTask(t)}"/>
                                                </td>
                                            </tr>
                                        </ui:repeat>
                                        </tbody>
                                    </table>
                                </h:form>
                            </div>

                            <br/>
                            <br/>


                        </div>

                    </div>
                </div>
            </div>
        </h:panelGroup>


    </h:body>
</f:view>
</html>
